#循环输出九九乘法表

str_MultDemo = "\t"*2 + "{}*{}={:<4}"

#for正序
print("for正序")
print("\tBegin")
for i in range(1,10):
    for j in range(1,i + 1):
        print(str_MultDemo.format(j,i,j*i),end=" ")
    print("")
print("\tEnd")

#for倒序
print("for倒序")
print("\tBegin")
for i in range(9,0,-1):
    for j in range(1,i+1):
        print(str_MultDemo.format(j,i,j*i),end=" ")
    print("")
print("\tEnd")


#while正序
print("while正序")
print("\tBegin")
i = 1
while i <= 9:
    j = 1
    while j < i + 1:
        print(str_MultDemo.format(j,i,j*i),end=" ")
        j+= 1
    print("")
    i+=1
print("\tEnd")



#while倒序
print("while倒序")
print("\tBegin")
i = 9
while i >= 1:
    j = 1
    while j < i + 1:
        print(str_MultDemo.format(j,i,j*i),end=" ")
        j+= 1
    print("")
    i-=1
print("\tEnd")